package com.yami.shop.combo.api.config;

import lombok.AllArgsConstructor;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 套餐、赠品
 * @author lanhai
 */
@Configuration("comboSwaggerConfiguration")
@AllArgsConstructor
public class SwaggerConfiguration {

//    private final ApiInfo apiInfo;
//
//    @Bean
//    public Docket comboRestApi() {
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(apiInfo)
//                .groupName("套餐、赠品接口")
//                .select()
//                .apis(RequestHandlerSelectors.basePackage("com.yami.shop.combo.api.controller"))
//                .paths(PathSelectors.any())
//                .build();
//    }

    @Bean
    public GroupedOpenApi comboRestApi() {
        return GroupedOpenApi.builder()
                .group("套餐、赠品接口")
                .packagesToScan("com.yami.shop.combo.api.controller")
                .pathsToMatch("/**")
                .build();
    }


}
